#pragma once
/**
 * This class handles all the operations regarding the actual raycast of a position in a map.
 */

using namespace gen;

namespace rcast
{
class Raycaster
{
public:
	/**
	 * Constructs a new raycaster singleton, with a given map structure.
	 *
	 * @param map_conf the current map configuration to which the raycast will perform.
	 * @param player_pos the structure representing the player position
	 */
	Raycaster ( gen::mapConf			*map_conf const,
				gen::PlayerPos			*player_pos );




	/**
	 * Casts a ray from the current player position.
	 *
	 * @return the pixel level position, of the ray intersection, in the map
	 */
	gen::mapPos CastRay ();



	/**
	 *
	 *		TODO:
	 *
	 *			void reloadMap ( const gen::mapConf			&map_conf ) throws (<some_raycast_related_exception>);
	 */

	/**
	 * Destroys the raycaster object.
	 */
	~Raycaster ();

private:
	gen::PlayerPos			*ppos;			//the internal position of the player
	gen::mapConf			*mconf			//the current map
	gen::angle				currAngle;		//current angle of the current ray
};
}
